'use strict';

var vt2geojson = require('./');

const fs = require('fs');

// remote file
vt2geojson({
    uri: 'http://60.30.105.251:8000/vt/xzq/12/3381/1556.pbf',
    layer: 'zhen'
}, function (err, result) {
    if (err) throw err;
    console.log(result); // => GeoJSON FeatureCollection
    console.log(result.features[0].properties); 
    console.log(result.features[0].geometry.coordinates[0][0]);

     
    let data = JSON.stringify(result);
    console.log(data);

    fs.writeFileSync('./data/geojson_result/zhen-12-3381-1556.json', data); 

});



vt2geojson({
    uri: 'http://60.30.105.251:8000/vt/xzq/12/3381/1557.pbf',
    layer: 'zhen'
}, function (err, result) {
    if (err) throw err;
    console.log(result); // => GeoJSON FeatureCollection
    console.log(result.features[0].properties); 
    console.log(result.features[0].geometry.coordinates[0][0]);

     
    let data = JSON.stringify(result);
    console.log(data);

    fs.writeFileSync('./data/geojson_result/zhen-12-3381-1557.json', data); 

});